package mysqlCodeGen.gen.utils;

import lombok.Data;

import java.io.InputStream;
import java.util.Properties;

/**
 * @author loser
 * @date 2023-01-09  17:19
 */

@Data
public class PropReader {

    private String file;
    InputStream in;
    Properties properties;

    public PropReader(String file) {

        try {
            this.file = file;
            properties = new Properties();
            in = PropReader.class.getClassLoader().getResourceAsStream(file);
            properties.load(in);
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

    public String getValue(String key) {
        return properties.getProperty(key);
    }

}
